package com.auto.nastoolbox.components

import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.lifecycle.viewmodel.compose.viewModel
import androidx.navigation.NavHostController
import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import com.auto.base.post.AppContainer
import com.auto.nastoolbox.NasDestinations
import com.auto.nastoolbox.screens.HomeScreen
import com.auto.nastoolbox.screens.HomeViewModel
import com.auto.nastoolbox.screens.SettingScreen

/**
 * Created by YuanWei1 on 2025/6/4.
 *
 * Description:
 */

@Composable
fun NasNavGraph(
    appContainer: AppContainer,
    isExpandedScreen: Boolean,
    modifier: Modifier = Modifier,
    navController: NavHostController = rememberNavController(),
    openDrawer: () -> Unit = {},
    startDestination: String = NasDestinations.HOME_ROUTE,
) {
    NavHost(navController = navController, startDestination = startDestination, modifier = modifier) {
        composable(
            route = NasDestinations.HOME_ROUTE,
        ) { navBackStackEntry ->
            val homeViewModel: HomeViewModel = viewModel(factory = HomeViewModel.provideFactory())
            HomeScreen()
        }
        composable(route = NasDestinations.SETTING) {
            SettingScreen(navController)
        }
    }
}